package com.liu.efk.zdcq.controller;

import com.liu.common.domain.ResultVo;
import com.liu.efk.zdcq.pojo.User;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.jcajce.provider.digest.Tiger;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by shi860715@126.com
 * Date 2021/5/12 16:41
 * Description
 */
@Slf4j
@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {

    @PostMapping("/login")
    public ResultVo login(@RequestBody User user){
        Map map = new HashMap();
        map.put("token","23423423423423432423452543256234562");
        return  ResultVo.success("登录成功",map);
    }

    @PostMapping("/userinfo")
    public ResultVo userInfo(String name,String password){
        Map<String,Object> result= new HashMap<>();
        result.put("name","张三");
        result.put("avatar","12131");
        result.put("menus","菜单");
        return  ResultVo.success("用户信息",result);
    }


    @PostMapping("/logout")
    public ResultVo logout(){
        Map<String,Object> result= new HashMap<>();

        return  ResultVo.success("用户推出登录",result);
    }
}
